package eu.simrun;

import java.util.LinkedList;
import java.util.List;

/**
 * 运行任务装载器
 * @author wzz
 */
public final class RunLoader {
	
	List<RunThread> threads = new LinkedList<RunThread>();

	/**
	 * 添加
	 * @param process
	 * @param processCount
	 */
	public void addProcess(RunProcess process, int processCount) {
		while(processCount > 0) {
			threads.add(new RunThread(process));
			processCount--;
		}
	}
	
	public void run(){
		for(RunThread thread:threads) {
			thread.start();
		}
	}

	public void addProcess(RunProcess process) {
		threads.add(new RunThread(process));
	}
	
}
